Skip to content

[Bug]: context.getSource() is not a function (react-hooks/exhaustive-deps) #3887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
neoncube2 opened this issue Feb 19, 2025 · 2 comments
Closed
2 tasks done
Labels

Comments

@neoncube2
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

When running yarn eslint app/, I get this error:

Oops! Something went wrong! :(

ESLint: 9.20.1

TypeError: context.getSource is not a function
Occurred while linting C:\example\app\components\course\example.jsx:93
Rule: "react-hooks/exhaustive-deps"
    at visitFunctionWithDependencies (C:\example\.yarn\__virtual__\eslint-plugin-react-hooks-virtual-5f4daa2ead\0\cache\eslint-plugin-react-hooks-npm-4.6.0-b429fac07f-3c63134e05.zip\node_modules\eslint-plugin-react-hooks\cjs\eslint-plugin-react-hooks.development.js:1704:42)
    at visitCallExpression (C:\example\.yarn\__virtual__\eslint-plugin-react-hooks-virtual-5f4daa2ead\0\cache\eslint-plugin-react-hooks-npm-4.6.0-b429fac07f-3c63134e05.zip\node_modules\eslint-plugin-react-hooks\cjs\eslint-plugin-react-hooks.development.js:1759:11)
    at ruleErrorHandler (C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\linter.js:1160:48)
    at C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\node-event-generator.js:337:14)
    at runRules (C:\example\.yarn\__virtual__\eslint-virtual-f7fc0c0de8\0\cache\eslint-npm-9.20.1-5c3419cdfc-b1d870135c.zip\node_modules\eslint\lib\linter\linter.js:1204:40)

Oops! Something went wrong! :(

ESLint: 9.20.1

AbortError: The operation was aborted
    at checkAborted (node:fs:343:14)
    at Object.readFile (node:fs:381:7)
    at C:\example\.pnp.cjs:13313:19
    at new Promise (<anonymous>)
    at NodeFS.readFilePromise (C:\example\.pnp.cjs:13311:18)
    at makeCallPromise.async.subPath.subPath (C:\example\.pnp.cjs:14004:32)
    at ZipOpenFS.makeCallPromise (C:\example\.pnp.cjs:14122:20)
    at ZipOpenFS.readFilePromise (C:\example\.pnp.cjs:14003:17)
    at VirtualFS.readFilePromise (C:\example\.pnp.cjs:12921:24)
    at PosixFS.readFilePromise (C:\example\.pnp.cjs:12921:24)

Oops! Something went wrong! :(

ESLint: 9.20.1

AbortError: The operation was aborted
    at ReadFileContext.read (node:internal/fs/read/context:92:9)
    at FSReqCallback.readFileAfterStat [as oncomplete] (node:fs:338:11)

Let me know if there's anything I can do to help track this down :)

Expected Behavior

eslint-plugin-react version

v7.37.4

eslint version

v9.20.1

node version

v22.13.0

@neoncube2 neoncube2 added the bug label Feb 19, 2025
@ljharb
Copy link
Member

ljharb commented Feb 19, 2025

This is the react plugin, not the react-hooks plugin.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2025
@neoncube2
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants